import React from 'react';
import {
  View,
  TouchableOpacity,
  Text,
} from 'react-native';

import TComponent from './TComponent';
import SizeUtils from '../common/SizeUtils';

export default class TButton extends TComponent {
  constructor(props) {
    super(props);
  }

  render() {
    return (
      <TouchableOpacity style={[{flexDirection:"row", alignItems:"center", justifyContent:"center",
        backgroundColor:"#ffffff", borderRadius:SizeUtils.translateDesignNumToCode(10)}, this.props.style]}
          onPress={this._onPress.bind(this)}>
        <Text style={{color:this.props.color, fontSize:SizeUtils.translateFontSizeToCode(this.props.fontSize),
            textAlign:"center"}}>
          {this.props.label}
        </Text>
      </TouchableOpacity>
    )
  }

  _onPress() {
    this.props.onPress();
  }
}
